.TH E1432_SET_TRIGGER_MASTER 3 E1432
.SH NAME
.nf
e1432_set_trigger_master \- Set trigger master state
e1432_get_trigger_master \- Get current trigger master state
.fi
.IX e1432_set_trigger_master(3) 3
.IX e1432_get_trigger_master(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_trigger_master(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 state)
SHORTSIZ16 e1432_get_trigger_master(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 *state)
.cE
.SH DESCRIPTION
\fIe1432_set_trigger_master\fR sets the trigger master state of a module
when using one of the RPM arming modes in a multiple module system.  
These RPM arming
mode are \fBE1432_ARM_RPM_RUNUP, E1432_ARM_RPM_RUNDOWN, \fRand\fB 
E1432_ARM_RPM_DELTA\fR, and are set by \fIe1432_set_arm_mode\fR.
This is used to allow the module with the AYF tachometer option 
to be the master module.
This module then sends each trigger point to the host computer, which relays 
it to all slave modules using the \fIe1432_send_trigger\fR function.

\fIe1432_get_trigger_master\fR returns the current trigger master 
state of a module.

This parameter is a "global" parameter.  It applies to an entire E1432
module rather than to one of its channels.  The \fIID\fR parameter is
used only to identify which module the function applies to, and all
channels in that module will report the same value for this parameter.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single channel.

\fIstate\fR enables/disables the ability of the module to be a master.
The legal values are \fBE1432_TRIGGER_MASTER_ON\fR and
\fBE1432_TRIGGER_MASTER_OFF\fR.  At each trigger point on the master
module while it is in one of the RPM arming modes, an index of the 
trigger point in the data FIFO is stored for transmission to
the host and the \fBE1432_IRQ_TRIGGER\fR bit in the
\fBE1432_IRQ_STATUS2_REG\fR register is set.  This bit can be polled
or interrupted upon using \fIe1432_set_interrupt_mask\fR.  When this
bit is set, it is up to the host program to call the
\fIe1432_send_trigger\fR function, which will read the trigger index
from the master module and send it to all of the slave modules.  Since
the data FIFOs on all modules operate synchronously, this FIFO index
will be the exact trigger point in the slave modules as well.  This
triggering scheme only works when the data mode has been set by the
\fIe1432_set_data_mode\fR function to be
\fBE1432_DATA_MODE_OVERLAP_BLOCK\fR, so that multiple triggers can be
stored.

If \fIID\fR is a groupID and the \fIstate\fR is \fBE1432_TRIGGER_MASTER_ON\fR
the first module associated with the group is picked.  If \fIID\fR is a channel
ID then the module with that channel is picked.  
.SH "RESET VALUE"
After a reset, \fIstate\fR is set to \fBE1432_TRIGGER_MASTER_OFF\fR.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_send_trigger, e1432_set_arm_mode, e1432_set_data_mode
.ad
